package com.example.myapplication;

import android.os.SystemClock;

import com.example.myapplication.fragment.MySurface;

public class GraphThread extends Thread {
    private MySurface surface;
    private boolean isRun;

    public GraphThread(MySurface s) {
        surface = s;
    }

    public void setRun() {
        isRun = true;
    }
    public void setPause() {
        isRun = false;
    }

    @Override
    public void run() {
        while (isRun)
        {
            SystemClock.sleep(1000/50);
            surface.postInvalidate();
        }
    }
}

